package com.ldzy.service.impl;

import com.ldzy.dao.UserMapper;
import com.ldzy.pojo.User;
import com.ldzy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(User user) {
        return userMapper.login(user);
    }

    @Override
    public List<User> selectStaff() {
        return userMapper.selectStaff();
    }

    @Override
    public User findById(int uid) {//根据uid查询信息并返回
        return userMapper.findById(uid);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteById(int uid) {
            return userMapper.deleteById(uid);

    }
}
